Tag: Character uppercase variable indicates English read BSP char = =Design ideas:1. First read the text file. Assigns the contents of the resulting text to Str2. Convert this string to a char array with a For loop at (for Char ch= ' a ';chWhen ch==
For information about an English text, count the number of uppercase letters, lowercase letters, spaces, and punctuation marks.$manuscript = "Where There is a would, there is a."; /string literal$smallLetter = 0;$capitalLetter = 0;$blank =
/*
Determines whether the specified content is null. If it is null, a warning box is displayed.
*/
Function isEmpty (theValue, strMsg ){
If (theValue = ""){
Alert (strMsg + "cannot be blank! ");
Return true;
}
Return false;
}
/*
Chinese judgment
Title: give you a text containing different English letters and punctuation, you want to find the most important letters, the letters returned must be lowercase, when checking the most wanted letters, is not case-sensitive, so in your search "a" =
In Android development, you often encounter the requirement that the text content entered in the input box should limit 10 characters or 20 letters. Before also on the internet to see a lot of solutions, the effect is not very good, most are
1.
VaR Reg =/^ (\ w | [\ u4e00-\ u9fa5]) * $ /;If (ARR = username. Match (REG )){Ti = 1;Return ture;}Else{Alert ("the user name can only contain English letters, numbers and Chinese characters. \ n check whether there are spaces or other symbols
Question: enter a line of characters to calculate the numbers of English letters, spaces, numbers, and other characters.1. Program analysis: Using the while statement, the condition is that the input character is not '\ n '.Import java. util.
Requirement: enter a string to count the number of words. Words are separated by spaces. Multiple spaces are allowed. Algorithm . Example: input: I love ChinaOutput:I:1Love:2China:1 First, we thought of a simulated method. We used
(a) Title: Accept an input, if the uppercase letter is converted into lowercase letters, lowercase letters to uppercase.For example:[Email protected] hushuai]# bash 4.shInput:dingxueDingxue[Email protected] hushuai]#
Method (1)The shell code
The following is a sample code for determining the input string length in JavaScript code (Chinese characters are counted as two characters, and letters and numbers are counted as one ). I think this is quite good. now I will share it with you and
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.